from classfile.attribute_info import AttributeInfo


class BootstrapMethod:
    def __init__(self, methodRef, arguments):
        self.bootstrapMethodRef = methodRef
        self.bootstrapArguments = arguments


class BootstrapMethodsAttribute(AttributeInfo):
    def __init__(self):
        super().__init__()
        self.bootstrapMethods = []

    def readInfo(self, clsReader):
        numOfMethods = int.from_bytes(clsReader.readU16(), "big")
        for i in range(numOfMethods):
            self.bootstrapMethods.append(BootstrapMethod(clsReader.readU16(), clsReader.readU16()))


